import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';

//列表
export const columns: BasicColumn[] = [
  {
    title: '流程实例ID',
    align:"center",
    dataIndex: 'id'
  },
  {
    title: '流程名称',
    align:"center",
    dataIndex: 'name'
  },
  {
    title: '申请人',
    align:"center",
    dataIndex: 'applyer'
  },
  {
    title: '标识Key',
    align:"center",
    dataIndex: 'key'
  },
  {
    title: '版本',
    align:"center",
    dataIndex: 'version',
    customRender:({text}) => {
      return 'v.'+text;
    },
   },
   {
    title: '当前环节',
    align:"center",
    dataIndex: 'currTaskName'
  },
  {
    title: '状态',
    align:"center",
    dataIndex: 'isSuspended',
    customRender:({text}) => {
      text=text==false?0:1;
      let arr=['已激活','已挂起'];
      return arr[text];
    },
  },
];

//查询
export const searchFormSchema: FormSchema[] = [
  {
    label: '流程名称',
    field: 'name',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '标识Key',
    field: 'key',
    component: 'Input',
    colProps: { span: 6 },
  },
];
